import React, { Component, PropTypes } from 'react'
import { hashHistory } from 'react-router'
import { TabBar } from '../footer'
import { TopHeader, Address } from './'
import { Carousel, Progress, Modal } from 'antd-mobile'
import moment from 'moment'
import { myFetch, config, helper } from '../utils'
import { ProjectAlert } from '../project'

const alert = Modal.alert

export default class MainPage extends Component {
  constructor() {
    super()
    this.state = {
      data: [],
      num: 0,
    }
    this.onChange = this.onChange.bind(this)
  }
  onChange(a, b, c) {
    console.log(a)
  }
  render() {
    return (
      <div className="rt-main-container">
        <TopHeader />
        <Carousel afterchange={this.onChange.bind(this)} className="rt-carousel" autoplay infinite>
          <div className="-one">
            <h2>溢唐数据</h2>
            <p>国家首家跨境Pre-IPO股权合投平台</p>
            <div className="-btn" onClick={(e)=>hashHistory.push('/register')}>
              精明投资人注册
            </div>
          </div>
          <div className="-one">
            <h2>溢唐数据</h2>
            <p>国家首家跨境Pre-IPO股权合投平台</p>
            <div className="-btn" onClick={(e)=>hashHistory.push('/register')}>
              精明投资人注册
            </div>
          </div>
          <div className="-one">
            <h2>溢唐数据</h2>
            <p>国家首家跨境Pre-IPO股权合投平台</p>
            <div className="-btn" onClick={(e)=>hashHistory.push('/register')}>
              精明投资人注册
            </div>
          </div>
        </Carousel>
        <div className="cm-scrollable-container -body">
          <ul className="-list">
                <li className="-item">
                <div className="-item-top">
                  <div className="-item-show">
                    <div className="-left">
                      <img src={require('../../statics/images/pj01.png')} />
                    </div>
                    <div className="-right">
                      <div className="-title">
                        <strong>
                          title
                        </strong>
                      </div>
                      <p>描述</p>
                      <div className="-price">起投：</div>
                    </div>
                  </div>
                  <div className="-progress">
                    <Progress  position="normal" />
                    <span className="-show"></span>
                  </div>
                </div>
                <div className="-item-bottom">
                <span
                    className="-btn2"
                  >
                    查看详情
                  </span>
                  <span
                    className="-btn1"
                  >

                    {/*onClick={
                      () => {
                        hashHistory.push({
                          pathname: '/share/project',
                          query: {
                            id: val.id
                          }
                        })
                      }
                    } 点击跳到对应的详情页
                    */}
                    <img src={require('../../statics/images/icon_share_s.png')} />
                    <em>关注</em>
                  </span>
                  
                </div>
              </li>
          </ul>
          <Address />
        </div>
        <TabBar activeIndex={1} />
      </div>
      )
  }
}